export const channel = new BroadcastChannel('my-channel');
export function sendMessage(obj){
    channel.postMessage(obj)
}
export function receiveMessage(handler){
    channel.addEventListener('message', event => {
        handler(event.data)
    });
    return ()=>{
        channel.close()
    }

}
export let numberCount=0
export function addCount(){
    numberCount++
    alert(numberCount)
}
export function reduceCount(){
    numberCount--
}